<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
</head>
<body>
	<form id="form" method="post">
		<input name="username" placeholder="username" value="1" class="form-control" /><br>
		<input name="password" placeholder="password" value="1" class="form-control" />
	</form>
	
	<button id='btn1' class='btn btn-default' >submit-find</button>
	<button id='btn2' class='btn btn-default' >submit-query</button>
	<button id='btn3' class='btn btn-default' >ajax-serialize-find</button>
	<button id='btn4' class='btn btn-default' >ajax-serialize-query</button>
	<script>
		//type 1 find
		$("#btn1").click(function(){
			var form = $('#form');
			form[0].action='${contextPath}/userController/find.do';
			form.submit();
		});
		
		//type 2 findUserByQuery
		$("#btn2").click(function(){
			var form = $('#form');
			form[0].action='${contextPath}/userController/findUserByQuery.do';
			form.submit();
		});
		
		//type 3
		$("#btn3").click(function(){
			$.ajax({
				url:'${contextPath}/userController/find.do',
				type:'post',
				data:$('#form').serialize(),
				success:function(result){
				}
			});
		});
		
		//type 4 
		$("#btn4").click(function(){
			$.ajax({
				url:'${contextPath}/userController/findUserByQuery.do',
				type:'post',
				data:$('#form').serialize(),
				success:function(result){
				}
			});
		});
	</script>
</body>
</html>